﻿using System.Data.SqlServerCe;
using System.IO;

namespace WinFormsDemoApplication
{
    public class Utility
    {
        public static void CreateClientDatabaseIfDoesNotExist()
        {
            using (SqlCeConnection clientConn = new SqlCeConnection(global::WinFormsDemoApplication.Properties.Settings.Default.ClientConnectionString))
            {
                if (!File.Exists(clientConn.Database))
                {
                    SqlCeEngine sqlCeEngine = new SqlCeEngine(global::WinFormsDemoApplication.Properties.Settings.Default.ClientConnectionString);
                    sqlCeEngine.CreateDatabase();
                }
            }
        }
    }
}
